<!-- HTML header for doxygen 1.8.20-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
	<meta http-equiv="X-UA-Compatible" content="IE=9"/>
	<meta name="generator" content="Doxygen 1.9.4"/>
	<meta name="viewport" content="width=device-width, initial-scale=1"/>
	<title>Raspberry Pi Pico SDK: include/hardware/uart.h Source File</title>
	<!-- <link href="tabs.css" rel="stylesheet" type="text/css"/> -->
	<script type="text/javascript" src="jquery.js"></script>
	<script type="text/javascript" src="dynsections.js"></script>
	<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
	<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
    <link href="https://fonts.googleapis.com/css2?family=Roboto:wght@300;400;500&display=swap" rel="stylesheet">
	<link href="doxygen.css" rel="stylesheet" type="text/css" />
	<link href="normalise.css" rel="stylesheet" type="text/css"/>
<link href="main.css" rel="stylesheet" type="text/css"/>
<link href="styles.css" rel="stylesheet" type="text/css"/>
</head>
<body>
	<div class="navigation-mobile">
		<div class="logo--mobile">
			<a href="/"><img src="logo-mobile.svg" alt="Raspberry Pi"></a>
		</div>
		<div class="navigation-toggle">
			<span class="line-1"></span>
			<span class="line-2">
				<p>Menu Toggle</p>
			</span>
			<span class="line-3"></span>
		</div>
	</div>
	<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
		<div class="logo">
			<a href="index.html"> <img src="logo.svg" alt="Raspberry Pi"></a>
			<span style="display: inline-block; margin-top: 10px;">
				v2.1.0
			</span>
		</div>
		<div class="navigation-footer">
			<img src="logo-mobile.svg" alt="Raspberry Pi">
			<a href="https://www.raspberrypi.com/" target="_blank">By Raspberry Pi Ltd</a>
		</div>
<!-- 		<div class="search">
			<form>
				<input type="search" name="search" id="search" placeholder="Search">
				<input type="submit" value="Search">
			</form>
		</div> -->
<!-- Generated by Doxygen 1.9.4 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search",'Search','.html');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
$(document).ready(function(){initNavTree('rp2__common_2hardware__uart_2include_2hardware_2uart_8h_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle"><div class="title">uart.h</div></div>
</div><!--header-->
<div class="contents">
<a href="rp2__common_2hardware__uart_2include_2hardware_2uart_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno">    1</span><span class="comment">/*</span></div>
<div class="line"><a id="l00002" name="l00002"></a><span class="lineno">    2</span><span class="comment"> * Copyright (c) 2020 Raspberry Pi (Trading) Ltd.</span></div>
<div class="line"><a id="l00003" name="l00003"></a><span class="lineno">    3</span><span class="comment"> *</span></div>
<div class="line"><a id="l00004" name="l00004"></a><span class="lineno">    4</span><span class="comment"> * SPDX-License-Identifier: BSD-3-Clause</span></div>
<div class="line"><a id="l00005" name="l00005"></a><span class="lineno">    5</span><span class="comment"> */</span></div>
<div class="line"><a id="l00006" name="l00006"></a><span class="lineno">    6</span> </div>
<div class="line"><a id="l00007" name="l00007"></a><span class="lineno">    7</span><span class="preprocessor">#ifndef _HARDWARE_UART_H</span></div>
<div class="line"><a id="l00008" name="l00008"></a><span class="lineno">    8</span><span class="preprocessor">#define _HARDWARE_UART_H</span></div>
<div class="line"><a id="l00009" name="l00009"></a><span class="lineno">    9</span> </div>
<div class="line"><a id="l00010" name="l00010"></a><span class="lineno">   10</span><span class="preprocessor">#include &quot;<a class="code" href="pico_8h.html">pico.h</a>&quot;</span></div>
<div class="line"><a id="l00011" name="l00011"></a><span class="lineno">   11</span><span class="preprocessor">#include &quot;hardware/structs/uart.h&quot;</span></div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno">   12</span> </div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno">   13</span><span class="comment">// PICO_CONFIG: PARAM_ASSERTIONS_ENABLED_HARDWARE_UART, Enable/disable assertions in the hardware_uart module, type=bool, default=0, group=hardware_uart</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno">   14</span><span class="preprocessor">#ifndef PARAM_ASSERTIONS_ENABLED_HARDWARE_UART</span></div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno">   15</span><span class="preprocessor">#ifdef PARAM_ASSERTIONS_ENABLED_UART </span><span class="comment">// backwards compatibility with SDK &lt; 2.0.0</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno">   16</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_UART PARAM_ASSERTIONS_ENABLED_UART</span></div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno">   17</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno">   18</span><span class="preprocessor">#define PARAM_ASSERTIONS_ENABLED_HARDWARE_UART 0</span></div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno">   19</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno">   20</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno">   21</span> </div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno">   22</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno">   23</span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {</div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno">   24</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno">   25</span> </div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno">   26</span><span class="comment">// PICO_CONFIG: PICO_UART_ENABLE_CRLF_SUPPORT, Enable/disable CR/LF translation support, type=bool, default=1, group=hardware_uart</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno">   27</span><span class="preprocessor">#ifndef PICO_UART_ENABLE_CRLF_SUPPORT</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno">   28</span><span class="preprocessor">#define PICO_UART_ENABLE_CRLF_SUPPORT 1</span></div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno">   29</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno">   30</span> </div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno">   31</span><span class="comment">// PICO_CONFIG: PICO_UART_DEFAULT_CRLF, Enable/disable CR/LF translation on UART, type=bool, default=0, depends=PICO_UART_ENABLE_CRLF_SUPPORT, group=hardware_uart</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno">   32</span><span class="preprocessor">#ifndef PICO_UART_DEFAULT_CRLF</span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno">   33</span><span class="preprocessor">#define PICO_UART_DEFAULT_CRLF 0</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno">   34</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00035" name="l00035"></a><span class="lineno">   35</span> </div>
<div class="line"><a id="l00036" name="l00036"></a><span class="lineno">   36</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_UART, Define the default UART used for printf etc, min=0, max=1, default=Usually provided via board header, group=hardware_uart</span></div>
<div class="line"><a id="l00037" name="l00037"></a><span class="lineno">   37</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_UART_TX_PIN, Define the default UART TX pin, min=0, max=47 on RP2350B, 29 otherwise, default=Usually provided via board header, group=hardware_uart</span></div>
<div class="line"><a id="l00038" name="l00038"></a><span class="lineno">   38</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_UART_RX_PIN, Define the default UART RX pin, min=0, max=47 on RP2350B, 29 otherwise, default=Usually provided via board header, group=hardware_uart</span></div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno">   39</span> </div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno">   40</span><span class="comment">// PICO_CONFIG: PICO_DEFAULT_UART_BAUD_RATE, Define the default UART baudrate, max=921600, default=115200, group=hardware_uart</span></div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno">   41</span><span class="preprocessor">#ifndef PICO_DEFAULT_UART_BAUD_RATE</span></div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="rp2__common_2hardware__uart_2include_2hardware_2uart_8h.html#a9d632e2b9ebe40f979efa3ca340aaddc">   42</a></span><span class="preprocessor">#define PICO_DEFAULT_UART_BAUD_RATE 115200   </span></div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno">   43</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno">   44</span> </div>
<div class="line"><a id="l00076" name="l00076"></a><span class="lineno">   76</span><span class="comment">// Currently always a pointer to hw but it might not be in the future</span></div>
<div class="line"><a id="l00077" name="l00077"></a><span class="lineno">   77</span><span class="keyword">typedef</span> <span class="keyword">struct </span>uart_inst uart_inst_t;</div>
<div class="line"><a id="l00078" name="l00078"></a><span class="lineno">   78</span> </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">   86</a></span><span class="preprocessor">#define uart0 ((uart_inst_t *)uart0_hw) </span></div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">   87</a></span><span class="preprocessor">#define uart1 ((uart_inst_t *)uart1_hw) </span></div>
<div class="line"><a id="l00088" name="l00088"></a><span class="lineno">   88</span> </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno">   97</span><span class="preprocessor">#if !defined(PICO_DEFAULT_UART_INSTANCE) &amp;&amp; defined(PICO_DEFAULT_UART)</span></div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno">   98</span><span class="preprocessor">#define PICO_DEFAULT_UART_INSTANCE() (__CONCAT(uart,PICO_DEFAULT_UART))</span></div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno">   99</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno">  100</span> </div>
<div class="line"><a id="l00108" name="l00108"></a><span class="lineno">  108</span><span class="preprocessor">#ifdef PICO_DEFAULT_UART_INSTANCE</span></div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno">  109</span><span class="preprocessor">#define uart_default PICO_DEFAULT_UART_INSTANCE()</span></div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno">  110</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno">  111</span> </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno">  120</span><span class="preprocessor">#ifndef UART_NUM</span></div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno">  121</span><span class="keyword">static_assert</span>(NUM_UARTS == 2, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga12815b6262573d95c8a749f64cc85284">  122</a></span><span class="preprocessor">#define UART_NUM(uart) ((uart) == uart1)</span></div>
<div class="line"><a id="l00123" name="l00123"></a><span class="lineno">  123</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno">  124</span> </div>
<div class="line"><a id="l00133" name="l00133"></a><span class="lineno">  133</span><span class="preprocessor">#ifndef UART_INSTANCE</span></div>
<div class="line"><a id="l00134" name="l00134"></a><span class="lineno">  134</span><span class="keyword">static_assert</span>(NUM_UARTS == 2, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00135" name="l00135"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gadc5c5947dc577aac3d448fdb37647927">  135</a></span><span class="preprocessor">#define UART_INSTANCE(num) ((num) ? uart1 : uart0)</span></div>
<div class="line"><a id="l00136" name="l00136"></a><span class="lineno">  136</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00137" name="l00137"></a><span class="lineno">  137</span> </div>
<div class="line"><a id="l00147" name="l00147"></a><span class="lineno">  147</span><span class="preprocessor">#ifndef UART_DREQ_NUM</span></div>
<div class="line"><a id="l00148" name="l00148"></a><span class="lineno">  148</span><span class="preprocessor">#include &quot;hardware/regs/dreq.h&quot;</span></div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno">  149</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a4812587fa3aa4cfd7ea0d91e20246b95">DREQ_UART0_RX</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a80ecb62e37f0c5af2780b93d4995326d">DREQ_UART0_TX</a> + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno">  150</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ae5c7e2a566983a1148113e2987e059d5">DREQ_UART1_RX</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014aa64110e7f89692b9c789275b4d8b04c0">DREQ_UART1_TX</a> + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno">  151</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014aa64110e7f89692b9c789275b4d8b04c0">DREQ_UART1_TX</a> == <a class="code hl_enumvalue" href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a80ecb62e37f0c5af2780b93d4995326d">DREQ_UART0_TX</a> + 2, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00152" name="l00152"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga10472af6afab1cb220b5fbd4aee63a16">  152</a></span><span class="preprocessor">#define UART_DREQ_NUM(uart, is_tx) ({ \</span></div>
<div class="line"><a id="l00153" name="l00153"></a><span class="lineno">  153</span><span class="preprocessor">    DREQ_UART0_TX + UART_NUM(uart) * 2 + !(is_tx); \</span></div>
<div class="line"><a id="l00154" name="l00154"></a><span class="lineno">  154</span><span class="preprocessor">})</span></div>
<div class="line"><a id="l00155" name="l00155"></a><span class="lineno">  155</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00156" name="l00156"></a><span class="lineno">  156</span> </div>
<div class="line"><a id="l00165" name="l00165"></a><span class="lineno">  165</span><span class="preprocessor">#ifndef UART_CLOCK_NUM</span></div>
<div class="line"><a id="l00166" name="l00166"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga8b4f387572a62cc839eb004ce7c02e3f">  166</a></span><span class="preprocessor">#define UART_CLOCK_NUM(uart) clk_peri</span></div>
<div class="line"><a id="l00167" name="l00167"></a><span class="lineno">  167</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno">  168</span> </div>
<div class="line"><a id="l00177" name="l00177"></a><span class="lineno">  177</span><span class="preprocessor">#ifndef UART_FUNCSEL_NUM</span></div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno">  178</span><span class="preprocessor">#if PICO_RP2040</span></div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga7bceb145d3739e3923f64584eff6db59">  179</a></span><span class="preprocessor">#define UART_FUNCSEL_NUM(uart, gpio) GPIO_FUNC_UART</span></div>
<div class="line"><a id="l00180" name="l00180"></a><span class="lineno">  180</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00181" name="l00181"></a><span class="lineno">  181</span><span class="preprocessor">#define UART_FUNCSEL_NUM(uart, gpio) ((gpio) &amp; 0x2 ? GPIO_FUNC_UART_AUX : GPIO_FUNC_UART)</span></div>
<div class="line"><a id="l00182" name="l00182"></a><span class="lineno">  182</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00183" name="l00183"></a><span class="lineno">  183</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00184" name="l00184"></a><span class="lineno">  184</span> </div>
<div class="line"><a id="l00193" name="l00193"></a><span class="lineno">  193</span><span class="preprocessor">#ifndef UART_IRQ_NUM</span></div>
<div class="line"><a id="l00194" name="l00194"></a><span class="lineno">  194</span><span class="preprocessor">#include &quot;hardware/regs/intctrl.h&quot;</span></div>
<div class="line"><a id="l00195" name="l00195"></a><span class="lineno">  195</span><span class="keyword">static_assert</span>(<a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a1062848ec5bc51fcdd58a95d40fc266b">UART1_IRQ</a> == <a class="code hl_enumvalue" href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a504e54f28a2e2928bd6a1604ee0a24fb">UART0_IRQ</a> + 1, <span class="stringliteral">&quot;&quot;</span>);</div>
<div class="line"><a id="l00196" name="l00196"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga8697ddad82a2cd5d889ce819d83783e3">  196</a></span><span class="preprocessor">#define UART_IRQ_NUM(uart) (UART0_IRQ + UART_NUM(uart))</span></div>
<div class="line"><a id="l00197" name="l00197"></a><span class="lineno">  197</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00198" name="l00198"></a><span class="lineno">  198</span> </div>
<div class="line"><a id="l00207" name="l00207"></a><span class="lineno">  207</span><span class="preprocessor">#ifndef UART_RESET_NUM</span></div>
<div class="line"><a id="l00208" name="l00208"></a><span class="lineno">  208</span><span class="preprocessor">#include &quot;<a class="code" href="rp2__common_2hardware__resets_2include_2hardware_2resets_8h.html">hardware/resets.h</a>&quot;</span></div>
<div class="line"><a id="l00209" name="l00209"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gaffef755f98d8fcec5f7b5147924fb4f9">  209</a></span><span class="preprocessor">#define UART_RESET_NUM(uart) (uart_get_index(uart) ? RESET_UART1 : RESET_UART0)</span></div>
<div class="line"><a id="l00210" name="l00210"></a><span class="lineno">  210</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00211" name="l00211"></a><span class="lineno">  211</span> </div>
<div class="line"><a id="l00218" name="l00218"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">  218</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">uart_get_index</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00219" name="l00219"></a><span class="lineno">  219</span>    invalid_params_if(HARDWARE_UART, uart != <a class="code hl_define" href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a> &amp;&amp; uart != <a class="code hl_define" href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a>);</div>
<div class="line"><a id="l00220" name="l00220"></a><span class="lineno">  220</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__uart.html#ga12815b6262573d95c8a749f64cc85284">UART_NUM</a>(uart);</div>
<div class="line"><a id="l00221" name="l00221"></a><span class="lineno">  221</span>}</div>
<div class="line"><a id="l00222" name="l00222"></a><span class="lineno">  222</span> </div>
<div class="line"><a id="l00229" name="l00229"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gafd9aaeaae78307db7f51aa39f501b972">  229</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uart_inst_t *<a class="code hl_function" href="group__hardware__uart.html#gafd9aaeaae78307db7f51aa39f501b972">uart_get_instance</a>(uint num) {</div>
<div class="line"><a id="l00230" name="l00230"></a><span class="lineno">  230</span>    invalid_params_if(HARDWARE_UART, num &gt;= NUM_UARTS);</div>
<div class="line"><a id="l00231" name="l00231"></a><span class="lineno">  231</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__uart.html#gadc5c5947dc577aac3d448fdb37647927">UART_INSTANCE</a>(num);</div>
<div class="line"><a id="l00232" name="l00232"></a><span class="lineno">  232</span>}</div>
<div class="line"><a id="l00233" name="l00233"></a><span class="lineno">  233</span> </div>
<div class="line"><a id="l00243" name="l00243"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">  243</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <a class="code hl_struct" href="structuart__hw__t.html">uart_hw_t</a> *<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00244" name="l00244"></a><span class="lineno">  244</span>    <a class="code hl_function" href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">uart_get_index</a>(uart); <span class="comment">// check it is a hw uart</span></div>
<div class="line"><a id="l00245" name="l00245"></a><span class="lineno">  245</span>    <span class="keywordflow">return</span> (<a class="code hl_struct" href="structuart__hw__t.html">uart_hw_t</a> *)uart;</div>
<div class="line"><a id="l00246" name="l00246"></a><span class="lineno">  246</span>}</div>
<div class="line"><a id="l00247" name="l00247"></a><span class="lineno">  247</span> </div>
<div class="line"><a id="l00251" name="l00251"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">  251</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> {</div>
<div class="line"><a id="l00252" name="l00252"></a><span class="lineno">  252</span>    UART_PARITY_NONE,</div>
<div class="line"><a id="l00253" name="l00253"></a><span class="lineno">  253</span>    UART_PARITY_EVEN,</div>
<div class="line"><a id="l00254" name="l00254"></a><span class="lineno">  254</span>    UART_PARITY_ODD</div>
<div class="line"><a id="l00255" name="l00255"></a><span class="lineno">  255</span>} <a class="code hl_enumeration" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a>;</div>
<div class="line"><a id="l00256" name="l00256"></a><span class="lineno">  256</span> </div>
<div class="line"><a id="l00257" name="l00257"></a><span class="lineno">  257</span><span class="comment">// ----------------------------------------------------------------------------</span></div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno">  258</span><span class="comment">// Setup</span></div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno">  259</span> </div>
<div class="line"><a id="l00280" name="l00280"></a><span class="lineno">  280</span>uint <a class="code hl_function" href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">uart_init</a>(uart_inst_t *uart, uint baudrate);</div>
<div class="line"><a id="l00281" name="l00281"></a><span class="lineno">  281</span> </div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno">  290</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga85b12f7d19f5087b22f26473039d2c4f">uart_deinit</a>(uart_inst_t *uart);</div>
<div class="line"><a id="l00291" name="l00291"></a><span class="lineno">  291</span> </div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno">  312</span>uint <a class="code hl_function" href="group__hardware__uart.html#gab7f2ad3380a44597d8dda42b2d2ddef9">uart_set_baudrate</a>(uart_inst_t *uart, uint baudrate);</div>
<div class="line"><a id="l00313" name="l00313"></a><span class="lineno">  313</span> </div>
<div class="line"><a id="l00321" name="l00321"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga54a9e298ebec96510e324bbab01247c7">  321</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga54a9e298ebec96510e324bbab01247c7">uart_set_hw_flow</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> cts, <span class="keywordtype">bool</span> rts) {</div>
<div class="line"><a id="l00322" name="l00322"></a><span class="lineno">  322</span>    <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;cr,</div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno">  323</span>                   (bool_to_bit(cts) &lt;&lt; UART_UARTCR_CTSEN_LSB) | (bool_to_bit(rts) &lt;&lt; UART_UARTCR_RTSEN_LSB),</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno">  324</span>                   UART_UARTCR_RTSEN_BITS | UART_UARTCR_CTSEN_BITS);</div>
<div class="line"><a id="l00325" name="l00325"></a><span class="lineno">  325</span>}</div>
<div class="line"><a id="l00326" name="l00326"></a><span class="lineno">  326</span> </div>
<div class="line"><a id="l00348" name="l00348"></a><span class="lineno">  348</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga07e3c6ce7c1abf5e875b62964b8f841e">uart_set_format</a>(uart_inst_t *uart, uint data_bits, uint stop_bits, <a class="code hl_enumeration" href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a> parity);</div>
<div class="line"><a id="l00349" name="l00349"></a><span class="lineno">  349</span> </div>
<div class="line"><a id="l00360" name="l00360"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">  360</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">uart_set_irqs_enabled</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> rx_has_data, <span class="keywordtype">bool</span> tx_needs_data) {</div>
<div class="line"><a id="l00361" name="l00361"></a><span class="lineno">  361</span>    <span class="comment">// Both UARTRXINTR (RX) and UARTRTINTR (RX timeout) interrupts are</span></div>
<div class="line"><a id="l00362" name="l00362"></a><span class="lineno">  362</span>    <span class="comment">// required for rx_has_data. RX asserts when &gt;=4 characters are in the RX</span></div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno">  363</span>    <span class="comment">// FIFO (for RXIFLSEL=0). RT asserts when there are &gt;=1 characters and no</span></div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno">  364</span>    <span class="comment">// more have been received for 32 bit periods.</span></div>
<div class="line"><a id="l00365" name="l00365"></a><span class="lineno">  365</span>    <a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;imsc = (bool_to_bit(tx_needs_data) &lt;&lt; UART_UARTIMSC_TXIM_LSB) |</div>
<div class="line"><a id="l00366" name="l00366"></a><span class="lineno">  366</span>                              (bool_to_bit(rx_has_data) &lt;&lt; UART_UARTIMSC_RXIM_LSB) |</div>
<div class="line"><a id="l00367" name="l00367"></a><span class="lineno">  367</span>                              (bool_to_bit(rx_has_data) &lt;&lt; UART_UARTIMSC_RTIM_LSB);</div>
<div class="line"><a id="l00368" name="l00368"></a><span class="lineno">  368</span>    <span class="keywordflow">if</span> (rx_has_data) {</div>
<div class="line"><a id="l00369" name="l00369"></a><span class="lineno">  369</span>        <span class="comment">// Set minimum threshold</span></div>
<div class="line"><a id="l00370" name="l00370"></a><span class="lineno">  370</span>        <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;ifls, 0 &lt;&lt; UART_UARTIFLS_RXIFLSEL_LSB,</div>
<div class="line"><a id="l00371" name="l00371"></a><span class="lineno">  371</span>                        UART_UARTIFLS_RXIFLSEL_BITS);</div>
<div class="line"><a id="l00372" name="l00372"></a><span class="lineno">  372</span>    }</div>
<div class="line"><a id="l00373" name="l00373"></a><span class="lineno">  373</span>    <span class="keywordflow">if</span> (tx_needs_data) {</div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno">  374</span>        <span class="comment">// Set maximum threshold</span></div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno">  375</span>        <a class="code hl_function" href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a>(&amp;<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;ifls, 0 &lt;&lt; UART_UARTIFLS_TXIFLSEL_LSB,</div>
<div class="line"><a id="l00376" name="l00376"></a><span class="lineno">  376</span>                        UART_UARTIFLS_TXIFLSEL_BITS);</div>
<div class="line"><a id="l00377" name="l00377"></a><span class="lineno">  377</span>    }</div>
<div class="line"><a id="l00378" name="l00378"></a><span class="lineno">  378</span>}</div>
<div class="line"><a id="l00379" name="l00379"></a><span class="lineno">  379</span> </div>
<div class="line"><a id="l00380" name="l00380"></a><span class="lineno">  380</span><span class="comment">// backwards compatibility with SDK version &lt; 2.0.0</span></div>
<div class="line"><a id="l00381" name="l00381"></a><span class="lineno">  381</span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> uart_set_irq_enables(uart_inst_t *uart, <span class="keywordtype">bool</span> rx_has_data, <span class="keywordtype">bool</span> tx_needs_data) {</div>
<div class="line"><a id="l00382" name="l00382"></a><span class="lineno">  382</span>    <a class="code hl_function" href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">uart_set_irqs_enabled</a>(uart, rx_has_data, tx_needs_data);</div>
<div class="line"><a id="l00383" name="l00383"></a><span class="lineno">  383</span>}</div>
<div class="line"><a id="l00384" name="l00384"></a><span class="lineno">  384</span> </div>
<div class="line"><a id="l00391" name="l00391"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga6397bfad56e634a2ab31b6953a44caa7">  391</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__uart.html#ga6397bfad56e634a2ab31b6953a44caa7">uart_is_enabled</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00392" name="l00392"></a><span class="lineno">  392</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;cr &amp; UART_UARTCR_UARTEN_BITS;</div>
<div class="line"><a id="l00393" name="l00393"></a><span class="lineno">  393</span>}</div>
<div class="line"><a id="l00394" name="l00394"></a><span class="lineno">  394</span> </div>
<div class="line"><a id="l00411" name="l00411"></a><span class="lineno">  411</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gac3daee9514dacfb76f3c04b131e2e41a">uart_set_fifo_enabled</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> enabled);</div>
<div class="line"><a id="l00412" name="l00412"></a><span class="lineno">  412</span> </div>
<div class="line"><a id="l00413" name="l00413"></a><span class="lineno">  413</span><span class="comment">// ----------------------------------------------------------------------------</span></div>
<div class="line"><a id="l00414" name="l00414"></a><span class="lineno">  414</span><span class="comment">// Generic input/output</span></div>
<div class="line"><a id="l00415" name="l00415"></a><span class="lineno">  415</span> </div>
<div class="line"><a id="l00422" name="l00422"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">  422</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">uart_is_writable</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00423" name="l00423"></a><span class="lineno">  423</span>    <span class="keywordflow">return</span> !(<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;fr &amp; UART_UARTFR_TXFF_BITS);</div>
<div class="line"><a id="l00424" name="l00424"></a><span class="lineno">  424</span>}</div>
<div class="line"><a id="l00425" name="l00425"></a><span class="lineno">  425</span> </div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">  431</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">uart_tx_wait_blocking</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno">  432</span>    <span class="keywordflow">while</span> (<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;fr &amp; UART_UARTFR_BUSY_BITS) <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00433" name="l00433"></a><span class="lineno">  433</span>}</div>
<div class="line"><a id="l00434" name="l00434"></a><span class="lineno">  434</span> </div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">  442</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">uart_is_readable</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno">  443</span>    <span class="comment">// PL011 doesn&#39;t expose levels directly, so return values are only 0 or 1</span></div>
<div class="line"><a id="l00444" name="l00444"></a><span class="lineno">  444</span>    <span class="keywordflow">return</span> !(<a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;fr &amp; UART_UARTFR_RXFE_BITS);</div>
<div class="line"><a id="l00445" name="l00445"></a><span class="lineno">  445</span>}</div>
<div class="line"><a id="l00446" name="l00446"></a><span class="lineno">  446</span> </div>
<div class="line"><a id="l00459" name="l00459"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">  459</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">uart_write_blocking</a>(uart_inst_t *uart, <span class="keyword">const</span> uint8_t *src, <span class="keywordtype">size_t</span> len) {</div>
<div class="line"><a id="l00460" name="l00460"></a><span class="lineno">  460</span>    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; len; ++i) {</div>
<div class="line"><a id="l00461" name="l00461"></a><span class="lineno">  461</span>        <span class="keywordflow">while</span> (!<a class="code hl_function" href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">uart_is_writable</a>(uart))</div>
<div class="line"><a id="l00462" name="l00462"></a><span class="lineno">  462</span>            <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00463" name="l00463"></a><span class="lineno">  463</span>        <a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;dr = *src++;</div>
<div class="line"><a id="l00464" name="l00464"></a><span class="lineno">  464</span>    }</div>
<div class="line"><a id="l00465" name="l00465"></a><span class="lineno">  465</span>}</div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno">  466</span> </div>
<div class="line"><a id="l00476" name="l00476"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">  476</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">uart_read_blocking</a>(uart_inst_t *uart, uint8_t *dst, <span class="keywordtype">size_t</span> len) {</div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno">  477</span>    <span class="keywordflow">for</span> (<span class="keywordtype">size_t</span> i = 0; i &lt; len; ++i) {</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno">  478</span>        <span class="keywordflow">while</span> (!<a class="code hl_function" href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">uart_is_readable</a>(uart))</div>
<div class="line"><a id="l00479" name="l00479"></a><span class="lineno">  479</span>            <a class="code hl_function" href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a>();</div>
<div class="line"><a id="l00480" name="l00480"></a><span class="lineno">  480</span>        *dst++ = (uint8_t) <a class="code hl_function" href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a>(uart)-&gt;dr;</div>
<div class="line"><a id="l00481" name="l00481"></a><span class="lineno">  481</span>    }</div>
<div class="line"><a id="l00482" name="l00482"></a><span class="lineno">  482</span>}</div>
<div class="line"><a id="l00483" name="l00483"></a><span class="lineno">  483</span> </div>
<div class="line"><a id="l00484" name="l00484"></a><span class="lineno">  484</span><span class="comment">// ----------------------------------------------------------------------------</span></div>
<div class="line"><a id="l00485" name="l00485"></a><span class="lineno">  485</span><span class="comment">// UART-specific operations and aliases</span></div>
<div class="line"><a id="l00486" name="l00486"></a><span class="lineno">  486</span> </div>
<div class="line"><a id="l00495" name="l00495"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">  495</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a>(uart_inst_t *uart, <span class="keywordtype">char</span> c) {</div>
<div class="line"><a id="l00496" name="l00496"></a><span class="lineno">  496</span>    <a class="code hl_function" href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">uart_write_blocking</a>(uart, (<span class="keyword">const</span> uint8_t *) &amp;c, 1);</div>
<div class="line"><a id="l00497" name="l00497"></a><span class="lineno">  497</span>}</div>
<div class="line"><a id="l00498" name="l00498"></a><span class="lineno">  498</span> </div>
<div class="line"><a id="l00507" name="l00507"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">  507</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">uart_putc</a>(uart_inst_t *uart, <span class="keywordtype">char</span> c) {</div>
<div class="line"><a id="l00508" name="l00508"></a><span class="lineno">  508</span><span class="preprocessor">#if PICO_UART_ENABLE_CRLF_SUPPORT</span></div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno">  509</span>    <span class="keyword">extern</span> <span class="keywordtype">short</span> uart_char_to_line_feed[NUM_UARTS];</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno">  510</span>    <span class="keywordflow">if</span> (uart_char_to_line_feed[<a class="code hl_function" href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">uart_get_index</a>(uart)] == c)</div>
<div class="line"><a id="l00511" name="l00511"></a><span class="lineno">  511</span>        <a class="code hl_function" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a>(uart, <span class="charliteral">&#39;\r&#39;</span>);</div>
<div class="line"><a id="l00512" name="l00512"></a><span class="lineno">  512</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00513" name="l00513"></a><span class="lineno">  513</span>    <a class="code hl_function" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a>(uart, c);</div>
<div class="line"><a id="l00514" name="l00514"></a><span class="lineno">  514</span>}</div>
<div class="line"><a id="l00515" name="l00515"></a><span class="lineno">  515</span> </div>
<div class="line"><a id="l00524" name="l00524"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">  524</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">uart_puts</a>(uart_inst_t *uart, <span class="keyword">const</span> <span class="keywordtype">char</span> *s) {</div>
<div class="line"><a id="l00525" name="l00525"></a><span class="lineno">  525</span><span class="preprocessor">#if PICO_UART_ENABLE_CRLF_SUPPORT</span></div>
<div class="line"><a id="l00526" name="l00526"></a><span class="lineno">  526</span>    <span class="keywordtype">bool</span> last_was_cr = <span class="keyword">false</span>;</div>
<div class="line"><a id="l00527" name="l00527"></a><span class="lineno">  527</span>    <span class="keywordflow">while</span> (*s) {</div>
<div class="line"><a id="l00528" name="l00528"></a><span class="lineno">  528</span>        <span class="comment">// Don&#39;t add extra carriage returns if one is present</span></div>
<div class="line"><a id="l00529" name="l00529"></a><span class="lineno">  529</span>        <span class="keywordflow">if</span> (last_was_cr)</div>
<div class="line"><a id="l00530" name="l00530"></a><span class="lineno">  530</span>            <a class="code hl_function" href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a>(uart, *s);</div>
<div class="line"><a id="l00531" name="l00531"></a><span class="lineno">  531</span>        <span class="keywordflow">else</span></div>
<div class="line"><a id="l00532" name="l00532"></a><span class="lineno">  532</span>            <a class="code hl_function" href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">uart_putc</a>(uart, *s);</div>
<div class="line"><a id="l00533" name="l00533"></a><span class="lineno">  533</span>        last_was_cr = *s++ == <span class="charliteral">&#39;\r&#39;</span>;</div>
<div class="line"><a id="l00534" name="l00534"></a><span class="lineno">  534</span>    }</div>
<div class="line"><a id="l00535" name="l00535"></a><span class="lineno">  535</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00536" name="l00536"></a><span class="lineno">  536</span>    <span class="keywordflow">while</span> (*s)</div>
<div class="line"><a id="l00537" name="l00537"></a><span class="lineno">  537</span>        <a class="code hl_function" href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">uart_putc</a>(uart, *s++);</div>
<div class="line"><a id="l00538" name="l00538"></a><span class="lineno">  538</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00539" name="l00539"></a><span class="lineno">  539</span>}</div>
<div class="line"><a id="l00540" name="l00540"></a><span class="lineno">  540</span> </div>
<div class="line"><a id="l00549" name="l00549"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga652497b933112c1759f892a03c657fec">  549</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">char</span> <a class="code hl_function" href="group__hardware__uart.html#ga652497b933112c1759f892a03c657fec">uart_getc</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00550" name="l00550"></a><span class="lineno">  550</span>    <span class="keywordtype">char</span> c;</div>
<div class="line"><a id="l00551" name="l00551"></a><span class="lineno">  551</span>    <a class="code hl_function" href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">uart_read_blocking</a>(uart, (uint8_t *) &amp;c, 1);</div>
<div class="line"><a id="l00552" name="l00552"></a><span class="lineno">  552</span>    <span class="keywordflow">return</span> c;</div>
<div class="line"><a id="l00553" name="l00553"></a><span class="lineno">  553</span>}</div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno">  554</span> </div>
<div class="line"><a id="l00561" name="l00561"></a><span class="lineno">  561</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gaddb01507886acab5604a2eecc014b388">uart_set_break</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> en);</div>
<div class="line"><a id="l00562" name="l00562"></a><span class="lineno">  562</span> </div>
<div class="line"><a id="l00569" name="l00569"></a><span class="lineno">  569</span><span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#ga4ea0b7b9252cd22e2395ca6070000f7a">uart_set_translate_crlf</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> translate);</div>
<div class="line"><a id="l00570" name="l00570"></a><span class="lineno">  570</span> </div>
<div class="line"><a id="l00574" name="l00574"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gaaa85ae059028b3f38e612e55042a8272">  574</a></span><span class="keyword">static</span> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code hl_function" href="group__hardware__uart.html#gaaa85ae059028b3f38e612e55042a8272">uart_default_tx_wait_blocking</a>(<span class="keywordtype">void</span>) {</div>
<div class="line"><a id="l00575" name="l00575"></a><span class="lineno">  575</span><span class="preprocessor">#ifdef uart_default</span></div>
<div class="line"><a id="l00576" name="l00576"></a><span class="lineno">  576</span>    <a class="code hl_function" href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">uart_tx_wait_blocking</a>(uart_default);</div>
<div class="line"><a id="l00577" name="l00577"></a><span class="lineno">  577</span><span class="preprocessor">#else</span></div>
<div class="line"><a id="l00578" name="l00578"></a><span class="lineno">  578</span>    assert(<span class="keyword">false</span>);</div>
<div class="line"><a id="l00579" name="l00579"></a><span class="lineno">  579</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00580" name="l00580"></a><span class="lineno">  580</span>}</div>
<div class="line"><a id="l00581" name="l00581"></a><span class="lineno">  581</span> </div>
<div class="line"><a id="l00589" name="l00589"></a><span class="lineno">  589</span><span class="keywordtype">bool</span> <a class="code hl_function" href="group__hardware__uart.html#ga026539f355b6c6f5a044a5f4ee051f0e">uart_is_readable_within_us</a>(uart_inst_t *uart, uint32_t us);</div>
<div class="line"><a id="l00590" name="l00590"></a><span class="lineno">  590</span> </div>
<div class="line"><a id="l00597" name="l00597"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">  597</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">uart_get_dreq_num</a>(uart_inst_t *uart, <span class="keywordtype">bool</span> is_tx) {</div>
<div class="line"><a id="l00598" name="l00598"></a><span class="lineno">  598</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__uart.html#ga10472af6afab1cb220b5fbd4aee63a16">UART_DREQ_NUM</a>(uart, is_tx);</div>
<div class="line"><a id="l00599" name="l00599"></a><span class="lineno">  599</span>}</div>
<div class="line"><a id="l00600" name="l00600"></a><span class="lineno">  600</span> </div>
<div class="line"><a id="l00606" name="l00606"></a><span class="lineno"><a class="line" href="group__hardware__uart.html#ga0759dec413fb5af3bcaa9691ba98bcb9">  606</a></span><span class="keyword">static</span> <span class="keyword">inline</span> uint <a class="code hl_function" href="group__hardware__uart.html#ga0759dec413fb5af3bcaa9691ba98bcb9">uart_get_reset_num</a>(uart_inst_t *uart) {</div>
<div class="line"><a id="l00607" name="l00607"></a><span class="lineno">  607</span>    <span class="keywordflow">return</span> <a class="code hl_define" href="group__hardware__uart.html#gaffef755f98d8fcec5f7b5147924fb4f9">UART_RESET_NUM</a>(uart);</div>
<div class="line"><a id="l00608" name="l00608"></a><span class="lineno">  608</span>}</div>
<div class="line"><a id="l00609" name="l00609"></a><span class="lineno">  609</span> </div>
<div class="line"><a id="l00610" name="l00610"></a><span class="lineno">  610</span><span class="comment">// backwards compatibility</span></div>
<div class="line"><a id="l00611" name="l00611"></a><span class="lineno">  611</span><span class="keyword">static</span> <span class="keyword">inline</span> uint uart_get_dreq(uart_inst_t *uart, <span class="keywordtype">bool</span> is_tx) {</div>
<div class="line"><a id="l00612" name="l00612"></a><span class="lineno">  612</span>    <span class="keywordflow">return</span> <a class="code hl_function" href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">uart_get_dreq_num</a>(uart, is_tx);</div>
<div class="line"><a id="l00613" name="l00613"></a><span class="lineno">  613</span>}</div>
<div class="line"><a id="l00614" name="l00614"></a><span class="lineno">  614</span> </div>
<div class="line"><a id="l00615" name="l00615"></a><span class="lineno">  615</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00616" name="l00616"></a><span class="lineno">  616</span>}</div>
<div class="line"><a id="l00617" name="l00617"></a><span class="lineno">  617</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00618" name="l00618"></a><span class="lineno">  618</span> </div>
<div class="line"><a id="l00619" name="l00619"></a><span class="lineno">  619</span><span class="preprocessor">#endif</span></div>
<div class="ttc" id="agroup__hardware__base_html_ga81b27e30abef56fe090d22fd8dfdbcc1"><div class="ttname"><a href="group__hardware__base.html#ga81b27e30abef56fe090d22fd8dfdbcc1">hw_write_masked</a></div><div class="ttdeci">static __force_inline void hw_write_masked(io_rw_32 *addr, uint32_t values, uint32_t write_mask)</div><div class="ttdoc">Set new values for a sub-set of the bits in a HW register.</div><div class="ttdef"><b>Definition:</b> address_mapped.h:171</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a4812587fa3aa4cfd7ea0d91e20246b95"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a4812587fa3aa4cfd7ea0d91e20246b95">DREQ_UART0_RX</a></div><div class="ttdeci">@ DREQ_UART0_RX</div><div class="ttdoc">Select UART0's RX FIFO as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:111</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014a80ecb62e37f0c5af2780b93d4995326d"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014a80ecb62e37f0c5af2780b93d4995326d">DREQ_UART0_TX</a></div><div class="ttdeci">@ DREQ_UART0_TX</div><div class="ttdoc">Select UART0's TX FIFO as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:110</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014aa64110e7f89692b9c789275b4d8b04c0"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014aa64110e7f89692b9c789275b4d8b04c0">DREQ_UART1_TX</a></div><div class="ttdeci">@ DREQ_UART1_TX</div><div class="ttdoc">Select UART1's TX FIFO as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:112</div></div>
<div class="ttc" id="agroup__hardware__dma_html_gga6f0a19defc495cfa6078364122266014ae5c7e2a566983a1148113e2987e059d5"><div class="ttname"><a href="group__hardware__dma.html#gga6f0a19defc495cfa6078364122266014ae5c7e2a566983a1148113e2987e059d5">DREQ_UART1_RX</a></div><div class="ttdeci">@ DREQ_UART1_RX</div><div class="ttdoc">Select UART1's RX FIFO as DREQ.</div><div class="ttdef"><b>Definition:</b> dreq.h:113</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8a1062848ec5bc51fcdd58a95d40fc266b"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a1062848ec5bc51fcdd58a95d40fc266b">UART1_IRQ</a></div><div class="ttdeci">@ UART1_IRQ</div><div class="ttdoc">Select UART1's IRQ output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:108</div></div>
<div class="ttc" id="agroup__hardware__irq_html_gga876b9495995a81dff786f07a1975c3b8a504e54f28a2e2928bd6a1604ee0a24fb"><div class="ttname"><a href="group__hardware__irq.html#gga876b9495995a81dff786f07a1975c3b8a504e54f28a2e2928bd6a1604ee0a24fb">UART0_IRQ</a></div><div class="ttdeci">@ UART0_IRQ</div><div class="ttdoc">Select UART0's IRQ output.</div><div class="ttdef"><b>Definition:</b> intctrl.h:107</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga026539f355b6c6f5a044a5f4ee051f0e"><div class="ttname"><a href="group__hardware__uart.html#ga026539f355b6c6f5a044a5f4ee051f0e">uart_is_readable_within_us</a></div><div class="ttdeci">bool uart_is_readable_within_us(uart_inst_t *uart, uint32_t us)</div><div class="ttdoc">Wait for up to a certain number of microseconds for the RX FIFO to be non empty.</div><div class="ttdef"><b>Definition:</b> uart.c:229</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga064c5c42afff8712a612d7ae50a58484"><div class="ttname"><a href="group__hardware__uart.html#ga064c5c42afff8712a612d7ae50a58484">uart_get_index</a></div><div class="ttdeci">static uint uart_get_index(uart_inst_t *uart)</div><div class="ttdoc">Convert UART instance to hardware instance number.</div><div class="ttdef"><b>Definition:</b> uart.h:218</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga0759dec413fb5af3bcaa9691ba98bcb9"><div class="ttname"><a href="group__hardware__uart.html#ga0759dec413fb5af3bcaa9691ba98bcb9">uart_get_reset_num</a></div><div class="ttdeci">static uint uart_get_reset_num(uart_inst_t *uart)</div><div class="ttdoc">Return the reset_num_t to use to reset a particular UART instance.</div><div class="ttdef"><b>Definition:</b> uart.h:606</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga07e3c6ce7c1abf5e875b62964b8f841e"><div class="ttname"><a href="group__hardware__uart.html#ga07e3c6ce7c1abf5e875b62964b8f841e">uart_set_format</a></div><div class="ttdeci">void uart_set_format(uart_inst_t *uart, uint data_bits, uint stop_bits, uart_parity_t parity)</div><div class="ttdoc">Set UART data format.</div><div class="ttdef"><b>Definition:</b> uart.c:183</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga10472af6afab1cb220b5fbd4aee63a16"><div class="ttname"><a href="group__hardware__uart.html#ga10472af6afab1cb220b5fbd4aee63a16">UART_DREQ_NUM</a></div><div class="ttdeci">#define UART_DREQ_NUM(uart, is_tx)</div><div class="ttdoc">Returns the dreq_num_t used for pacing DMA transfers to or from this UART instance....</div><div class="ttdef"><b>Definition:</b> uart.h:152</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga12815b6262573d95c8a749f64cc85284"><div class="ttname"><a href="group__hardware__uart.html#ga12815b6262573d95c8a749f64cc85284">UART_NUM</a></div><div class="ttdeci">#define UART_NUM(uart)</div><div class="ttdoc">Returns the UART number for a UART instance.</div><div class="ttdef"><b>Definition:</b> uart.h:122</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga1908247cb5f2468517b37d5a91798181"><div class="ttname"><a href="group__hardware__uart.html#ga1908247cb5f2468517b37d5a91798181">uart_set_irqs_enabled</a></div><div class="ttdeci">static void uart_set_irqs_enabled(uart_inst_t *uart, bool rx_has_data, bool tx_needs_data)</div><div class="ttdoc">Enable/Disable UART interrupt outputs.</div><div class="ttdef"><b>Definition:</b> uart.h:360</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga21c2cc29dcdc99ad970024dca52665a5"><div class="ttname"><a href="group__hardware__uart.html#ga21c2cc29dcdc99ad970024dca52665a5">uart_putc</a></div><div class="ttdeci">static void uart_putc(uart_inst_t *uart, char c)</div><div class="ttdoc">Write single character to UART for transmission, with optional CR/LF conversions.</div><div class="ttdef"><b>Definition:</b> uart.h:507</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga460772353a17df99adaf3352115c73d5"><div class="ttname"><a href="group__hardware__uart.html#ga460772353a17df99adaf3352115c73d5">uart_get_hw</a></div><div class="ttdeci">static uart_hw_t * uart_get_hw(uart_inst_t *uart)</div><div class="ttdoc">Get the real hardware UART instance from a UART instance.</div><div class="ttdef"><b>Definition:</b> uart.h:243</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga4752e5d03dd98a08d95705f68784fd15"><div class="ttname"><a href="group__hardware__uart.html#ga4752e5d03dd98a08d95705f68784fd15">uart_is_readable</a></div><div class="ttdeci">static bool uart_is_readable(uart_inst_t *uart)</div><div class="ttdoc">Determine whether data is waiting in the RX FIFO.</div><div class="ttdef"><b>Definition:</b> uart.h:442</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga4c45ff280c79aa60358d8241b7e5824b"><div class="ttname"><a href="group__hardware__uart.html#ga4c45ff280c79aa60358d8241b7e5824b">uart0</a></div><div class="ttdeci">#define uart0</div><div class="ttdoc">Identifier for UART instance 0.</div><div class="ttdef"><b>Definition:</b> uart.h:86</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga4ea0b7b9252cd22e2395ca6070000f7a"><div class="ttname"><a href="group__hardware__uart.html#ga4ea0b7b9252cd22e2395ca6070000f7a">uart_set_translate_crlf</a></div><div class="ttdeci">void uart_set_translate_crlf(uart_inst_t *uart, bool translate)</div><div class="ttdoc">Set CR/LF conversion on UART.</div><div class="ttdef"><b>Definition:</b> uart.c:221</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga54a9e298ebec96510e324bbab01247c7"><div class="ttname"><a href="group__hardware__uart.html#ga54a9e298ebec96510e324bbab01247c7">uart_set_hw_flow</a></div><div class="ttdeci">static void uart_set_hw_flow(uart_inst_t *uart, bool cts, bool rts)</div><div class="ttdoc">Set UART flow control CTS/RTS.</div><div class="ttdef"><b>Definition:</b> uart.h:321</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga5a55924eff530aff6db3b15fd872cda4"><div class="ttname"><a href="group__hardware__uart.html#ga5a55924eff530aff6db3b15fd872cda4">uart_init</a></div><div class="ttdeci">uint uart_init(uart_inst_t *uart, uint baudrate)</div><div class="ttdoc">Initialise a UART.</div><div class="ttdef"><b>Definition:</b> uart.c:42</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga6397bfad56e634a2ab31b6953a44caa7"><div class="ttname"><a href="group__hardware__uart.html#ga6397bfad56e634a2ab31b6953a44caa7">uart_is_enabled</a></div><div class="ttdeci">static bool uart_is_enabled(uart_inst_t *uart)</div><div class="ttdoc">Test if specific UART is enabled.</div><div class="ttdef"><b>Definition:</b> uart.h:391</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga64aa17c4b4382a59f7cb80c94f339d56"><div class="ttname"><a href="group__hardware__uart.html#ga64aa17c4b4382a59f7cb80c94f339d56">uart_putc_raw</a></div><div class="ttdeci">static void uart_putc_raw(uart_inst_t *uart, char c)</div><div class="ttdoc">Write single character to UART for transmission.</div><div class="ttdef"><b>Definition:</b> uart.h:495</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga652497b933112c1759f892a03c657fec"><div class="ttname"><a href="group__hardware__uart.html#ga652497b933112c1759f892a03c657fec">uart_getc</a></div><div class="ttdeci">static char uart_getc(uart_inst_t *uart)</div><div class="ttdoc">Read a single character from the UART.</div><div class="ttdef"><b>Definition:</b> uart.h:549</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga6bcc37e31dd40c204b4ac6f6189e8878"><div class="ttname"><a href="group__hardware__uart.html#ga6bcc37e31dd40c204b4ac6f6189e8878">uart_parity_t</a></div><div class="ttdeci">uart_parity_t</div><div class="ttdoc">UART Parity enumeration.</div><div class="ttdef"><b>Definition:</b> uart.h:251</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga85b12f7d19f5087b22f26473039d2c4f"><div class="ttname"><a href="group__hardware__uart.html#ga85b12f7d19f5087b22f26473039d2c4f">uart_deinit</a></div><div class="ttdeci">void uart_deinit(uart_inst_t *uart)</div><div class="ttdoc">DeInitialise a UART.</div><div class="ttdef"><b>Definition:</b> uart.c:95</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga94be41517216933ca961fd0464f74a6c"><div class="ttname"><a href="group__hardware__uart.html#ga94be41517216933ca961fd0464f74a6c">uart_puts</a></div><div class="ttdeci">static void uart_puts(uart_inst_t *uart, const char *s)</div><div class="ttdoc">Write string to UART for transmission, doing any CR/LF conversions.</div><div class="ttdef"><b>Definition:</b> uart.h:524</div></div>
<div class="ttc" id="agroup__hardware__uart_html_ga9d307ef71e3ce632be03bfd9bbe68117"><div class="ttname"><a href="group__hardware__uart.html#ga9d307ef71e3ce632be03bfd9bbe68117">uart_is_writable</a></div><div class="ttdeci">static bool uart_is_writable(uart_inst_t *uart)</div><div class="ttdoc">Determine if space is available in the TX FIFO.</div><div class="ttdef"><b>Definition:</b> uart.h:422</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gaaa85ae059028b3f38e612e55042a8272"><div class="ttname"><a href="group__hardware__uart.html#gaaa85ae059028b3f38e612e55042a8272">uart_default_tx_wait_blocking</a></div><div class="ttdeci">static void uart_default_tx_wait_blocking(void)</div><div class="ttdoc">Wait for the default UART's TX FIFO to be drained.</div><div class="ttdef"><b>Definition:</b> uart.h:574</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gab7f2ad3380a44597d8dda42b2d2ddef9"><div class="ttname"><a href="group__hardware__uart.html#gab7f2ad3380a44597d8dda42b2d2ddef9">uart_set_baudrate</a></div><div class="ttdeci">uint uart_set_baudrate(uart_inst_t *uart, uint baudrate)</div><div class="ttdoc">Set UART baud rate.</div><div class="ttdef"><b>Definition:</b> uart.c:155</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gac3daee9514dacfb76f3c04b131e2e41a"><div class="ttname"><a href="group__hardware__uart.html#gac3daee9514dacfb76f3c04b131e2e41a">uart_set_fifo_enabled</a></div><div class="ttdeci">void uart_set_fifo_enabled(uart_inst_t *uart, bool enabled)</div><div class="ttdoc">Enable/Disable the FIFOs on specified UART.</div><div class="ttdef"><b>Definition:</b> uart.c:199</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gad94ac6d5e345a1f794174d9bb7c6f69c"><div class="ttname"><a href="group__hardware__uart.html#gad94ac6d5e345a1f794174d9bb7c6f69c">uart1</a></div><div class="ttdeci">#define uart1</div><div class="ttdoc">Identifier for UART instance 1.</div><div class="ttdef"><b>Definition:</b> uart.h:87</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gada6a512414b1113a59725ddfbe23c4a5"><div class="ttname"><a href="group__hardware__uart.html#gada6a512414b1113a59725ddfbe23c4a5">uart_write_blocking</a></div><div class="ttdeci">static void uart_write_blocking(uart_inst_t *uart, const uint8_t *src, size_t len)</div><div class="ttdoc">Write to the UART for transmission.</div><div class="ttdef"><b>Definition:</b> uart.h:459</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gadc5c5947dc577aac3d448fdb37647927"><div class="ttname"><a href="group__hardware__uart.html#gadc5c5947dc577aac3d448fdb37647927">UART_INSTANCE</a></div><div class="ttdeci">#define UART_INSTANCE(num)</div><div class="ttdoc">Returns the UART instance with the given UART number.</div><div class="ttdef"><b>Definition:</b> uart.h:135</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gaddb01507886acab5604a2eecc014b388"><div class="ttname"><a href="group__hardware__uart.html#gaddb01507886acab5604a2eecc014b388">uart_set_break</a></div><div class="ttdeci">void uart_set_break(uart_inst_t *uart, bool en)</div><div class="ttdoc">Assert a break condition on the UART transmission.</div><div class="ttdef"><b>Definition:</b> uart.c:210</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gae8a066ef7339e7b22f05049435469234"><div class="ttname"><a href="group__hardware__uart.html#gae8a066ef7339e7b22f05049435469234">uart_read_blocking</a></div><div class="ttdeci">static void uart_read_blocking(uart_inst_t *uart, uint8_t *dst, size_t len)</div><div class="ttdoc">Read from the UART.</div><div class="ttdef"><b>Definition:</b> uart.h:476</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gaee105a6aeabd79da9244a098865e28cd"><div class="ttname"><a href="group__hardware__uart.html#gaee105a6aeabd79da9244a098865e28cd">uart_get_dreq_num</a></div><div class="ttdeci">static uint uart_get_dreq_num(uart_inst_t *uart, bool is_tx)</div><div class="ttdoc">Return the dreq_num_t to use for pacing transfers to/from a particular UART instance.</div><div class="ttdef"><b>Definition:</b> uart.h:597</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gafd9aaeaae78307db7f51aa39f501b972"><div class="ttname"><a href="group__hardware__uart.html#gafd9aaeaae78307db7f51aa39f501b972">uart_get_instance</a></div><div class="ttdeci">static uart_inst_t * uart_get_instance(uint num)</div><div class="ttdoc">Get the UART instance from an instance number.</div><div class="ttdef"><b>Definition:</b> uart.h:229</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gaff99ad133c2c808b69d1e12054c09f4a"><div class="ttname"><a href="group__hardware__uart.html#gaff99ad133c2c808b69d1e12054c09f4a">uart_tx_wait_blocking</a></div><div class="ttdeci">static void uart_tx_wait_blocking(uart_inst_t *uart)</div><div class="ttdoc">Wait for the UART TX fifo to be drained.</div><div class="ttdef"><b>Definition:</b> uart.h:431</div></div>
<div class="ttc" id="agroup__hardware__uart_html_gaffef755f98d8fcec5f7b5147924fb4f9"><div class="ttname"><a href="group__hardware__uart.html#gaffef755f98d8fcec5f7b5147924fb4f9">UART_RESET_NUM</a></div><div class="ttdeci">#define UART_RESET_NUM(uart)</div><div class="ttdoc">Returns the reset_num_t used to reset a given UART instance.</div><div class="ttdef"><b>Definition:</b> uart.h:209</div></div>
<div class="ttc" id="agroup__pico__platform_html_gab0d1ba75ceb64131e19f613d7a5313c9"><div class="ttname"><a href="group__pico__platform.html#gab0d1ba75ceb64131e19f613d7a5313c9">tight_loop_contents</a></div><div class="ttdeci">static __force_inline void tight_loop_contents(void)</div><div class="ttdoc">No-op function for the body of tight loops.</div><div class="ttdef"><b>Definition:</b> platform.h:80</div></div>
<div class="ttc" id="apico_8h_html"><div class="ttname"><a href="pico_8h.html">pico.h</a></div></div>
<div class="ttc" id="arp2__common_2hardware__resets_2include_2hardware_2resets_8h_html"><div class="ttname"><a href="rp2__common_2hardware__resets_2include_2hardware_2resets_8h.html">resets.h</a></div></div>
<div class="ttc" id="astructuart__hw__t_html"><div class="ttname"><a href="structuart__hw__t.html">uart_hw_t</a></div><div class="ttdef"><b>Definition:</b> uart.h:26</div></div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->

	<script src="main.js"></script>
</body>
</html>